package Chapter8;
//186页程序8.17

import java.awt.GraphicsEnvironment; //当前系统环境包

public class ListFonts {
    public static void main(String[] args) {
        GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment(); //获取当前系统环境并创建对象
        String[] fontNames = env.getAvailableFontFamilyNames(); //获取可用字体系列的名称，添加到字符串组
        System.out.println("可用字体共"+(fontNames.length+1)+"种");
        System.out.println("可用字体有：");
        for (int i = 0; i < fontNames.length; i++)
            System.out.println(" " + fontNames[i]);
    }
}
